package vip.jc.integration.dynamicwithshardingSphere.service;

import com.baomidou.dynamic.datasource.annotation.DS;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import vip.jc.integration.dynamicwithshardingSphere.dao.UserMapper;
import vip.jc.integration.dynamicwithshardingSphere.dao.entity.User;

@Slf4j
@Service
@DS("master")
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public User getById(Long id) {
        return userMapper.selectById(id);
    }

    public void addUser(User user) {
        userMapper.addUser(user);
    }

}
